# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=konsole
pkgver=24.08.2
pkgrel=0
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/applications/system/konsole"
pkgdesc="KDE's terminal emulator"
license="GPL-2.0-only AND LGPL-2.1-or-later AND Unicode-DFS-2016"
depends="ncurses-terminfo-base"
makedepends="
	extra-cmake-modules
	kbookmarks-dev
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kglobalaccel-dev
	kguiaddons-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knewstuff-dev
	knotifications-dev
	knotifyconfig-dev
	kparts-dev
	kpty-dev
	kservice-dev
	ktextwidgets-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	qt6-qtbase-dev
	qt6-qtmultimedia-dev
	samurai
	"
checkdepends="
	dbus
	mesa-dri-gallium
	xvfb-run
	"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/utilities/konsole.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/konsole-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_PLUGIN_SSHMANAGER=ON
	cmake --build build
}

check() {
	# TerminalInterfaceTest expects /bin/sh to not be a symlink
	dbus-run-session -- xvfb-run -a ctest --test-dir build --output-on-failure -E "TerminalInterfaceTest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bdd533bc4a09399e2d719bb32b1d0bf125208be169a4a6eb63ea2ddb0bc75c1204f23fd31ca89e3184e3363ebb310077c73d0da4ca451dbc2331dd8e1dcbdf36  konsole-24.08.2.tar.xz
"
